package aupdg.data.model.impl;

import aupdg.logic.analysis.SecurityLevel;

/**
 * LDG edge's data object.
 *
 * @author AA and CJ
 */
public class AuLdgData {

    private SecurityLevel level;
    private String dataLabel;

    /**
     * Constructor. Assigns a label to data object (for the presentation tier).
     *
     * @param dataLabel
     */
    public AuLdgData(String dataLabel) {
        this.dataLabel = dataLabel;
        this.level = SecurityLevel.LOW;
    }

    /**
     * Returns data object's label.
     *
     * @return
     */
    public String getDataLabel() {
        return dataLabel;
    }

    /**
     * Sets the data object's label.
     *
     * @param dataLabel
     */
    public void setDataLabel(String dataLabel) {
        this.dataLabel = dataLabel;
    }

    /**
     * Returns security level of data object.
     *
     * @return
     */
    public SecurityLevel getSecurityLevel() {
        return level;
    }

    /**
     * Sets the security level of the data object.
     *
     * @param level
     */
    public void setSecurityLevel(SecurityLevel level) {
        this.level = level;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final AuLdgData other = (AuLdgData) obj;
        if ((this.dataLabel == null) ? (other.dataLabel != null) : !this.dataLabel.equals(other.dataLabel)) {
            return false;
        }
        return true;
    }
}
